﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width">
    <title>上海七彩网络科技有限公司</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/admin.lib.min.css">
    <link rel="stylesheet" href="/css/admin.min.css">
    <link rel="stylesheet" href="/fonts/iconfont.min.css">
    <!--[if lt IE 9]>
    <script src="/js/html5shiv.min.js"></script>
    <script src="/js/respond.min.js"></script>
    <script src="/js/h5f.min.js"></script>
    <![endif]-->
    <script src="/js/jQuery-2.2.0.min.js"></script>
    <style>
        
    </style>
</head>
<body>
    <div id="vue_test2">
        <form id="user_form" role="form" action="/123" method="post" class="form-horizontal box" enctype="multipart/form-data" style="position:relative;padding:10px 8px;border:0;box-shadow:none">
            <div class="form-group">
                <label for="article_title" class="col-sm-2 control-label">微信文章地址</label>
                <div class="col-sm-8"><input type="text" class="form-control" v-model="url" required></div>
                <div class="col-sm-2" style="padding-left:0"><button type="button" class="btn btn-info" @click="getContent()" :disabled="submitting">获取内容</button></div>
            </div>
            <div class="form-group">
                <label for="article_content" class="col-sm-2 control-label">文章内容</label>
                <div class="col-sm-10">
                    <textarea name="Content" id="article_content" data-type="editor" style="width:100%;height:300px" required></textarea>
                </div>
            </div>
        </form>
    </div>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/admin.lib.min.js"></script>
    <script src="/js/UEditor/ueditor.all.min.js"></script>
    <script src="/js/UEditor/lang/zh-cn/zh-cn.js"></script>
    <script src="/js/vue.min.js"></script>
    <script src="/js/controls.min.js"></script>
    <script src="/js/admin.min.js"></script>
    <script>
        var article_editor_cont;
        new Vue({
            el: '#vue_test2',
            data: {
                submitting: false,
                url: ''
            },
            methods: {
                getContent: function () {
                    var self = this;
                    this.submitting = true;
                    $.ajax({
                        url: '/wexin/get',
                        type: 'POST',
                        timeout: 50000,
                        data: { url: self.url },
                        success: function (result) {
                            if (result.succ) {
                                article_editor_cont.setContent(unescape(result.data));
                            } else {
                                alert(result.data);
                            }
                        },
                        complete: function () {
                            self.submitting = false;
                        }
                    });
                }
            },
            mounted: function () {
                article_editor_cont = getEditor('article_content', { xssFilterRules: false, inputXssFilter: false, outputXssFilter: false });
            }
        });
    </script>
</body>
</html>